package cn.hnu.jpa.jpaExample.PrimaryKeyJoinColumn;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
public class PKJCCustomer implements Serializable{

	/**
	 * 主键关联
	 */
	private static final long serialVersionUID = 1L;
	
	private PKJCAddress addr;
	
	private String name;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private Integer id;

	@OneToOne(cascade = {CascadeType.ALL})
	@PrimaryKeyJoinColumn
	public PKJCAddress getAddr() {
		return addr;
	}

	public void setAddr(PKJCAddress addr) {
		this.addr = addr;
	}
@Id @GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	
}
